package nl.utwente.eemcs.graph;

import nl.utwente.eemcs.graph.distribution.DistributionLocation;

/**
 * A communicator node is used for communication between processes.
 * A communication node can be of type: InvokeReceive, InvokeResponse, Receive and Response
 * @author Evert Duipmans
 */
public class CommunicatorNode extends Node {

	/**
	 * Type of the communicator
	 */
	private CommunicatorType type;
	
	/**
	 * Get the communicator type
	 * @return Type of the communicator
	 */
	public CommunicatorType getType() {
		return type;
	}
	
	/**
	 * Set the type of the communicator
	 * @param type Communicator type
	 */
	public void setType(CommunicatorType type) {
		this.type = type;
	}

	/**
	 * Initializes a communicator node
	 * @param name Name of the communicator
	 * @param type Type of the communicator
	 */
	public CommunicatorNode(String name, CommunicatorType type) {
		super(name);
		this.type = type;
	}
	
	/**
	 * Initializes a communicator node
	 * @param name Name of the communicator
	 * @param type Type of the communicator
	 * @param distrLoc Distribution location of the communicator
	 */
	public CommunicatorNode(String name, CommunicatorType type, DistributionLocation distrLoc) {
		this(name, type);
		this.setLocation(distrLoc);
	}
}